//package com.xinheyun.demo.controller;
//import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
//import com.xinheyun.demo.model.param.DepartmentParam;
//import java.util.Optional;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.client.RestTemplate;
//
///**
// * 测试连接Mybatis-plus
// */
//@RestController
//@RequestMapping("api/v1/test/my")
//public class DemoController {
//
//    @Autowired
//    RestTemplate restTemplate ;
//    /**
//     * 查询所有用户信息
//     */
//
//    private final static String BASEURL = " https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=ACCESS_TOKEN&id=ID";
//    String accessToken = "5ugcc-2Du7UEtbLJvm7fJ0eo36_4T7MLSSMtIdLUaa9IQMsfwqv8Ih3XeZTV35eVcMu-dt--pLmSkLZO7opfytCyBS_GrybFB_tBBG2QNfO1I-spHMHMIBz8Etuy3Zjmjz2zsVZFAODBavW9SSbGnLAY5V6rPxHzf-lLuEXzN65UvAlDwLfIbTmtWCNaYxhRaE6A9g9hkD5AvbCRyFfljw";
//    @GetMapping("list")
//    public String test(){
//        ResponseEntity<DepartmentParam> entity = restTemplate
//            .getForEntity(BASEURL + "access_token=" + accessToken + "&id=" + "0", DepartmentParam.class);
//        if (entity.getStatusCode().is2xxSuccessful()) {
//            if (CollectionUtils.isEmpty(entity.getBody().getDepartment())) {
//                return Optional.empty();
//            }
//            return Optional.of(entity.getBody().getUserlist());
//        } else {
//            return Optional.empty();
//        }
//
//        }
//
//
//
//
//
//
//
//}
